<?
include ("conni.php");
if($_POST[item]=='login')
{
	$query="select * from user where user_id='".$_POST[user_id]."'";
	if($result=$conni->query($query))
	{
		$row=$result->fetch_assoc();
		if($row[passwd]==$_POST[password])
		{

			$_SESSION['user_id']=$row[id];
			$_SESSION['user_name']=$row[name];
			$_SESSION['user_dept']=$row[dept];
			$_SESSION['user_group']=$row[group];
			$_SESSION['user_title']=$row[title];
			$_SESSION['user_acc']=$row[acc];
			$_SESSION['user_lv']=$row[lv];
			$_SESSION['user_status']=$row[status];

			echo 'done';
		}
		else if($row[passwd]!=$_POST[password])
		{
			echo 'err';
		}
	}
}

?>